import axios from "../http/request"
import { getQueryVariable, judgeClient } from '../assets/js/tools'
//请求示例
//get
const urls = '';
export const get = (url = '', data) => {
  return axios({
    url: urls + url,
    method: "get",
    data
  })
}
//post
export const post = (url = '', data) => {
  return axios({
    url: urls + url,
    method: "post",
    data
  })
}

export const uploadFile = (url = '', file = '') => {
  let data = new FormData() // 创建form对象
  //注意files是对应后台的参数名哦   
  data.append('fileData', file)
  const token = getQueryVariable('token')
  data.append('token', token)
  data.append('system',judgeClient())
  let config = {
    contentType: 'multipart/form-data'
  }
  return axios({
    url: urls + url,
    method: "post",
    data,
    config
  })
}
